part of '../repository.dart';

const _kBackupFileContentFileTypeKey = 'file_type';
const _kBackupFileContentLanguageCodeKey = 'language_code';
const _kBackupFileContentVersionKey = 'version';
const _kBackupFileContentDataKey = 'data';

class _BackupFileContentDto extends Equatable {
  const _BackupFileContentDto._internal({
    required this.fileType,
    required this.languageCode,
    required this.version,
    required this.data,
  });

  final String fileType;
  final String languageCode;
  final int version;
  final String data;

  @override
  List<Object?> get props {
    return [
      fileType,
      languageCode,
      version,
      data,
    ];
  }

  factory _BackupFileContentDto.fromJson(Map<String, dynamic> json) {
    return _BackupFileContentDto._internal(
      fileType: json[_kBackupFileContentFileTypeKey],
      languageCode: json[_kBackupFileContentLanguageCodeKey],
      version: json[_kBackupFileContentVersionKey],
      data: json[_kBackupFileContentDataKey],
    );
  }

  Map<String, dynamic> toJson() {
    return {
      _kBackupFileContentFileTypeKey: fileType,
      _kBackupFileContentLanguageCodeKey: languageCode,
      _kBackupFileContentVersionKey: version,
      _kBackupFileContentDataKey: data,
    };
  }
}
